package compound.entity.duck;

import compound.QuackAble;
import compound.observer.Observable;
import compound.observer.Observer;

public class RubberDuck implements QuackAble {
    Observable observable;

    public RubberDuck() {
        observable = new Observable(this);
    }

    @Override
    public void quack() {
        System.out.println("吱吱吱");
    }

    @Override
    public void registerObserver(Observer observer) {
        observable.registerObserver(observer);
    }

    @Override
    public void notifyObservers() {
        observable.notifyObservers();
    }
}
